package com.ranjiaqi.thread09;

/**
 * @ClassName Single
 * @Description TODO
 * @Author hp
 * @Date 2021/6/28 20:34
 * @Version 1.0
 **/
public class Singlemould {
    //懒汉式
    private static Singlemould singlemould = null;
    private Singlemould(){}

    public static Singlemould getInstance(){
        if (singlemould==null){
            synchronized (Singlemould.class){
                if (singlemould==null){
                    singlemould = new Singlemould();
                }
            }
        }
        return singlemould;
    }
}
